<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    // 封闭对象
    const user={
        name:'小灰',
        age:18
    }
    // 使用冻结api,使用之后就不允许向对象进行增删查改
    Object.freeze(user);
    // 判断对象是否处于冻结状态
    console.log(Object.isFrozen(user));
    
    console.log(JSON.stringify(Object.getOwnPropertyDescriptors(user),null,2));
    
</script>
</html>